<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <!-- 引入 echarts.js -->
<script src="/js/plugins/echarts/echarts.common.min.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main" style="width: 1500px;height:800px;"></div>
<script type="text/javascript">
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
        legend: {},
        tooltip: {},
        dataset: {
            source: [
                ['分组类型', '总消费金额', '总优惠金额', '总实收金额'],
                <#list items as item>
                ['${item.groupByName}', ${item.totalAmount}, ${item.totaldiscount_amount},${item.totalPayAmount}],
                <#if item_index<(items?size-1)>
                    ,
                </#if>
                </#list>
            ]
        },
        xAxis: {type: 'category'},
        yAxis: {},
        // Declare several bar series, each will be mapped
        // to a column of dataset.source by default.
        series: [
            {type: 'bar'},
            {type: 'bar'},
            {type: 'bar'}
        ]
    };

    option && myChart.setOption(option);
</script>
</body>
</html>